<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="java.sql.*,vo.*,dao.*,java.util.ArrayList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>数据处理页面</title>
</head>
<body>
<jsp:useBean id="sdao" class="dao.StudentDao"></jsp:useBean>
<jsp:useBean id="stu" class="vo.Student"></jsp:useBean>
  <%
   String stuno=request.getParameter("stuno");
    String stuname=request.getParameter("stuname");
    if(null!=stuname&&!"".equals(stuname))stuname=new String(stuname.getBytes("iso-8859-1"),"utf-8"); 
    String stusex=request.getParameter("stusex");
    if(null!=stusex&&!"".equals(stusex))stusex=new String(stusex.getBytes("iso-8859-1"),"utf-8"); 
    String stuage=request.getParameter("stuage");
    int age=Integer.parseInt(stuage);
    stu.setStuno(stuno);
    stu.setStuname(stuname);
    stu.setStusex(stusex);
    stu.setStuage(age);
    if(null!=stuno){
    	sdao.insertOneStudent(stu);
   }else{
   		response.sendRedirect("stuAdmin.jsp");
   }
   %>   
   <center>
     <h2>添加学生信息</h2>
     <p>
      <br>
       新的数据已经添加到数据库中！
     </p>
    <form action="lookStudent.jsp" method="post">
       <input type="submit" value="返回">
    </form>
   </center>
</body>
</html>